#include<stdio.h>

int print_and_clear(int* A,int n){
    for(int i = 0;i<n;i++){printf("%d ",A[i]);A[i]=0;}
    return 0;
}

// utility function for input
int read_array(int *A){
    int n;
    printf("Enter the length of the array: ");
    scanf("%d",&n);
    printf("Enter the array seperated by white spaces: ");
    for(int i = 0;i<n;i++)scanf("%d",A+i);
    return n;
}

int main(){
    int A[1024];
    int n = read_array(A);
    n = print_and_clear(A,n);
    return 0;
}
